<?php
	$userName = $_POST['username'];
	$passWord = $_POST['password'];
	include("conn.php");
	if(""==$userName || ""==$passWord){
		echo "<script>alert('账号或为空，请重新输入');location=\"../adminLogin.html\"</script>";
	}
	$stmt = $db->query("select count(*) from administrator where username=\"".$userName."\" and password=md5(\"".$passWord."\")");
	$result = $stmt->fetch();
	if(1==$result[0]){
		echo "<script>alert('登录成功');location=\"../adminIndex.html\";</script>";
	}
	else{
		echo "<script>alert('账号或密码错误，请重试');location=\"../adminLogin.html\"</script>";
	}
?>